<!DOCTYPE html>
<html lang="{{ site.language | default: "zh-CN" }}">
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <!-- 基础SEO Meta标签 -->
    <title>{{ page.title | default: site.title }}</title>
    <meta name="description" content="{{ page.description | default: site.description }}">
    <meta name="keywords" content="{{ page.keywords | default: site.keywords }}">
    <meta name="author" content="{{ site.author }}">
    <meta name="robots" content="index, follow">
    <meta name="referrer" content="strict-origin-when-cross-origin">
    <link rel="canonical" href="{{ site.url }}{{ page.url }}">
    <link rel="alternate" type="application/rss+xml" title="{{ site.title }} RSS Feed" href="{{ site.url }}/feed.xml">
    
    <!-- Open Graph / Facebook -->
    <meta property="og:type" content="website">
    <meta property="og:url" content="{{ site.url }}{{ page.url }}">
    <meta property="og:title" content="{{ page.title | default: site.title }}">
    <meta property="og:description" content="{{ page.description | default: site.description }}">
    <meta property="og:site_name" content="{{ site.title }}">
    <meta property="og:locale" content="zh_CN">
    
    <!-- Twitter Card -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:url" content="{{ site.url }}{{ page.url }}">
    <meta name="twitter:title" content="{{ page.title | default: site.title }}">
    <meta name="twitter:description" content="{{ page.description | default: site.description }}">
    
    <!-- 移动端优化 -->
    <meta name="theme-color" content="#ffffff">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="apple-mobile-web-app-title" content="{{ site.title }}">
    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-config" content="/browserconfig.xml">
    
    <!-- PWA 相关 -->
    <meta name="mobile-web-app-capable" content="yes">
    
    <!-- 性能优化 -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link rel="dns-prefetch" href="//pagead2.googlesyndication.com">
    <link rel="dns-prefetch" href="//sdk.51.la">
    <link rel="dns-prefetch" href="//fonts.googleapis.com">
    <link rel="dns-prefetch" href="//fonts.gstatic.com">
    <link rel="preload" href="/assets/css/style.css" as="style">
    <link rel="preload" href="/favicon.ico" as="image">
    
    <!-- 样式和图标 -->
    <link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
    <link rel="icon" type="image/x-icon" href="/favicon.ico">
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
    <link rel="apple-touch-icon" href="/favicon.ico">
    
    <!-- 结构化数据 -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "WebSite",
      "name": "{{ site.title }}",
      "description": "{{ site.description }}",
      "url": "{{ site.url }}",
      "author": {
        "@type": "Person",
        "name": "{{ site.author }}"
      },
      "publisher": {
        "@type": "Organization",
        "name": "{{ site.title }}",
        "url": "{{ site.url }}",
        "logo": {
          "@type": "ImageObject",
          "url": "{{ site.url }}/favicon.ico"
        }
      },
      "potentialAction": {
        "@type": "SearchAction",
        "target": "{{ site.url }}/search?q={search_term_string}",
        "query-input": "required name=search_term_string"
      },
      "sameAs": [
        "https://github.com/vbskycn/iptv"
      ]
    }
    </script>
    
    <!-- 页面结构化数据 -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "WebPage",
      "name": "{{ page.title | default: site.title }}",
      "description": "{{ page.description | default: site.description }}",
      "url": "{{ site.url }}{{ page.url }}",
      "mainEntity": {
        "@type": "SoftwareApplication",
        "name": "IPTV直播源",
        "description": "免费开源的IPTV电视直播源，支持IPv4/IPv6双栈访问",
        "applicationCategory": "EntertainmentApplication",
        "operatingSystem": "Android, iOS, Windows, macOS, Linux",
        "offers": {
          "@type": "Offer",
          "price": "0",
          "priceCurrency": "CNY"
        }
      }
    }
    </script>
    
    {% include analytics.html %}
  </head>
  <body>
    <div class="page-header">
      <h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1>
      <h2 class="project-tagline">{{ page.description | default: site.description | default: site.github.project_tagline }}</h2>
      {% if site.show_downloads %}
        <a href="{{ site.github.zip_url }}" class="btn">Download .zip</a>
        <a href="{{ site.github.tar_url }}" class="btn">Download .tar.gz</a>
      {% endif %}
    </div>

    <div class="main-content">
      {% if page.hide_edgeone %}
        {% assign content_parts = content | split: '<!-- edgeone_start -->' %}
        {% if content_parts.size > 1 %}
          {% assign before_edgeone = content_parts[0] %}
          {% assign after_edgeone_parts = content_parts[1] | split: '<!-- edgeone_end -->' %}
          {% if after_edgeone_parts.size > 1 %}
            {% assign after_edgeone = after_edgeone_parts[1] %}
            {{ before_edgeone }}{{ after_edgeone }}
          {% else %}
            {{ before_edgeone }}
          {% endif %}
        {% else %}
          {{ content }}
        {% endif %}
      {% else %}
        {{ content }}
      {% endif %}

      <footer class="site-footer">
        <div class="footer-content">
          <p class="copyright">
            © 2025 <a href="https://live.zbds.org">live.zbds.org</a> All Rights Reserved. 
            <a href="https://github.com/vbskycn/iptv" target="_blank">GitHub</a>
          </p>
        </div>
      </footer>
    </div>

    <script src="{{ '/assets/js/main.js' | relative_url }}"></script>
    <!-- 51.la 统计代码 - 异步安装 -->
    <script>
    !function(p){"use strict";!function(t){var s=window,e=document,i=p,c="".concat("https:"===e.location.protocol?"https://":"http://","sdk.51.la/js-sdk-pro.min.js"),n=e.createElement("script"),r=e.getElementsByTagName("script")[0];n.type="text/javascript",n.setAttribute("charset","UTF-8"),n.async=!0,n.src=c,n.id="LA_COLLECT",i.d=n;var o=function(){s.LA.ids.push(i)};s.LA?s.LA.ids&&o():(s.LA=p,s.LA.ids=[],o()),r.parentNode.insertBefore(n,r)}()}({id:"24HGI6jBpBm7xvgT",ck:"24HGI6jBpBm7xvgT"});
    </script>
  </body>
</html> 